Optimal. Leaf size=53 \[ \frac{(a-b) \cot ^2(e+f x)}{2 f}+\frac{(a-b) \log (\sin (e+f x))}{f}-\frac{a \cot ^4(e+f x)}{4 f} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0422992, antiderivative size = 53, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 4, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.19, Rules used = {3629, 12, 3473, 3475} \[ \frac{(a-b) \cot ^2(e+f x)}{2 f}+\frac{(a-b) \log (\sin (e+f x))}{f}-\frac{a \cot ^4(e+f x)}{4 f} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3629
Rule 12
Rule 3473
Rule 3475
Rubi steps
\begin{align*} \int \cot ^5(e+f x) \left (a+b \tan ^2(e+f x)\right ) \, dx &=-\frac{a \cot ^4(e+f x)}{4 f}-\int (a-b) \cot ^3(e+f x) \, dx\\ &=-\frac{a \cot ^4(e+f x)}{4 f}-(a-b) \int \cot ^3(e+f x) \, dx\\ &=\frac{(a-b) \cot ^2(e+f x)}{2 f}-\frac{a \cot ^4(e+f x)}{4 f}-(-a+b) \int \cot (e+f x) \, dx\\ &=\frac{(a-b) \cot ^2(e+f x)}{2 f}-\frac{a \cot ^4(e+f x)}{4 f}+\frac{(a-b) \log (\sin (e+f x))}{f}\\ \end{align*}
Mathematica [A] time = 0.22429, size = 56, normalized size = 1.06 \[ \frac{2 (a-b) \cot ^2(e+f x)+4 (a-b) (\log (\tan (e+f x))+\log (\cos (e+f x)))-a \cot ^4(e+f x)}{4 f} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.043, size = 69, normalized size = 1.3 \begin{align*} -{\frac{b \left ( \cot \left ( fx+e \right ) \right ) ^{2}}{2\,f}}-{\frac{b\ln \left ( \sin \left ( fx+e \right ) \right ) }{f}}-{\frac{a \left ( \cot \left ( fx+e \right ) \right ) ^{4}}{4\,f}}+{\frac{ \left ( \cot \left ( fx+e \right ) \right ) ^{2}a}{2\,f}}+{\frac{a\ln \left ( \sin \left ( fx+e \right ) \right ) }{f}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.07745, size = 70, normalized size = 1.32 \begin{align*} \frac{2 \,{\left (a - b\right )} \log \left (\sin \left (f x + e\right )^{2}\right ) + \frac{2 \,{\left (2 \, a - b\right )} \sin \left (f x + e\right )^{2} - a}{\sin \left (f x + e\right )^{4}}}{4 \, f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.0591, size = 205, normalized size = 3.87 \begin{align*} \frac{2 \,{\left (a - b\right )} \log \left (\frac{\tan \left (f x + e\right )^{2}}{\tan \left (f x + e\right )^{2} + 1}\right ) \tan \left (f x + e\right )^{4} +{\left (3 \, a - 2 \, b\right )} \tan \left (f x + e\right )^{4} + 2 \,{\left (a - b\right )} \tan \left (f x + e\right )^{2} - a}{4 \, f \tan \left (f x + e\right )^{4}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 9.16975, size = 128, normalized size = 2.42 \begin{align*} \begin{cases} \tilde{\infty } a x & \text{for}\: \left (e = 0 \vee e = - f x\right ) \wedge \left (e = - f x \vee f = 0\right ) \\x \left (a + b \tan ^{2}{\left (e \right )}\right ) \cot ^{5}{\left (e \right )} & \text{for}\: f = 0 \\- \frac{a \log{\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} + \frac{a \log{\left (\tan{\left (e + f x \right )} \right )}}{f} + \frac{a}{2 f \tan ^{2}{\left (e + f x \right )}} - \frac{a}{4 f \tan ^{4}{\left (e + f x \right )}} + \frac{b \log{\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} - \frac{b \log{\left (\tan{\left (e + f x \right )} \right )}}{f} - \frac{b}{2 f \tan ^{2}{\left (e + f x \right )}} & \text{otherwise} \end{cases} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.343, size = 350, normalized size = 6.6 \begin{align*} -\frac{64 \,{\left (a - b\right )} \log \left (-\frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1} + 1\right ) - 32 \,{\left (a - b\right )} \log \left (-\frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1}\right ) + \frac{{\left (a + \frac{12 \, a{\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} - \frac{8 \, b{\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} + \frac{48 \, a{\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} - \frac{48 \, b{\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}}\right )}{\left (\cos \left (f x + e\right ) + 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) - 1\right )}^{2}} + \frac{12 \, a{\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} - \frac{8 \, b{\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} + \frac{a{\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}}}{64 \, f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]